const functions = [...Array(100).keys()].map(i => () => {
    // 模拟异步操作，如读取文件或网络请求
    return new Promise((resolve, reject) => {
      setTimeout(() => resolve(`Function ${i}`), Math.random() * 1000);
    });
  });
   
  const executeEveryFive = (functionsQueue) => {
    let executed = 0;
    let queue = functionsQueue.slice(); // 复制函数队列
   
    const executeNextFive = () => {
      let batch = queue.splice(0, 5); // 取出前五个函数
      let promises = batch.map(func => func()); // 执行这五个函数
   
      Promise.all(promises).then(results => {
        // 处理结果
        console.log(results);
   
        executed += batch.length;
        if (queue.length > 0) {
          setTimeout(executeNextFive, 100); // 继续执行剩余的函数
        }
      }).catch(error => {
        // 错误处理
        console.error(error);
      });
    };
   
    executeNextFive(); // 开始执行
  };
   
  executeEveryFive(functions);